package com.tgb.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="T_USER")
public class User {

	/*@GeneratedValue(generator = "paymentableGenerator")      
	@GenericGenerator(name = "paymentableGenerator", strategy = "native")*/
 // @GeneratedValue(generator="system-uuid")
 //	@GenericGenerator(name = "system-uuid",strategy="uuid")
//  @Column(length=32)
	private Integer id;
	
//	@Column(length=32)
	private String userName;
	
  //  @Column(length=32)
	private String age;
  
    private UserInfo userInfo;
    
	@Id 
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}
    @OneToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
    @JoinColumn(name="userinfo_id")
	public UserInfo getUserInfo() {
	return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}  
	
}